package com.kezesong.leasing.common;

import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

public class IdGeneratorUtil {

    public static String generatorIdStr(String machineId){
        Instant now = Instant.now(); //当前纳秒
        ZonedDateTime zonedDateTime = now.atZone(ZoneId.systemDefault());
        String yyyyMMddHHmmssSSSSSS = machineId+zonedDateTime.format(DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSSSSS"));
        return yyyyMMddHHmmssSSSSSS;
    }
}
